//
//  SecondViewController.swift
//  YiDa
//
//  Created by zhoufei on 16/6/26.
//  Copyright © 2016年 ZhouFei. All rights reserved.
//

import UIKit

class SecondViewController: UIViewController,UIWebViewDelegate {
    @IBOutlet weak var loading: UIActivityIndicatorView!
    @IBOutlet weak var webView: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        webView.delegate = self
        
        webView.loadRequest(NSURLRequest(URL: NSURL(string: "http://tm.digicircles.com/index.php/Home/Index/index/\(YiDaUser.main.userId!)/1")!))
        // Do any additional setup after loading the view, typically from a nib.
    }
    
    
    func webViewDidStartLoad(webView: UIWebView) {
        print("start")
        self.loading.startAnimating()
    }
    
    func webView(webView: UIWebView, didFailLoadWithError error: NSError?) {
        print("faile")
        self.loading.stopAnimating()
    }
    
    func webViewDidFinishLoad(webView: UIWebView) {
        print("finish")
        self.loading.stopAnimating()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

